<template>
  <div class="cityReview">
    <div class="x-main">
      <!-- 1 -->
      <div style="margin-bottom: 50px;">
        <div class="x-step_title">项目设计变更咨询（评审）信息</div>
        <div class="x-step_form">
          <el-form label-width="120px" :model="formData" :rules="formDataRules" ref="formData_1">
            <div style="display:flex;">
              <el-form-item label="咨询时间" prop="consultTime">
                <el-date-picker
                  type="date"
                  style="width:150px"
                  v-model="formData.consultTime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                ></el-date-picker>
              </el-form-item>
              <el-form-item label="复核时间" prop="reviewTime">
                <el-date-picker
                  type="date"
                  style="width:150px"
                  v-model="formData.reviewTime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                ></el-date-picker>
              </el-form-item>
              <el-form-item label="咨询地点">
                <el-input v-model="formData.reviewTime" placeholder="咨询地点" />
              </el-form-item>
            </div>
            <el-form-item label="咨询组长" prop="consultLeader">
              <el-input style="width:450px" v-model="formData.consultLeader"></el-input>
            </el-form-item>
            <el-form-item label="咨询成员" prop="consultMember">
              <el-input style="width:450px" v-model="formData.consultMember"></el-input>
            </el-form-item>
            <el-form-item label="咨询与复核情况" prop="consultReviewSituation">
              <el-input
                type="textarea"
                :rows="6"
                style="width:450px"
                v-model="formData.consultReviewSituation"
              ></el-input>
            </el-form-item>
          </el-form>
        </div>
      </div>
      <!-- 2 -->
      <div style="margin-bottom: 50px;">
        <div class="x-step_title">规划设计咨询资料</div>
        <div class="x-step-form">
          <el-form label-width="150px" :model="formData" :rules="formDataRules" ref="formData_2">
            <el-row style="width:600px">
              <el-col :span="24" :push="2">
                <el-form-item label="专家咨询意见书" prop="expertConsultAdviceFileId">
                  <el-upload :action="uploadUrl" :on-success="handleUploadSuccess">
                    <el-button type="primary" size="small">上传</el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
      </div>
      <!-- 3 -->
      <!-- <div style="padding-left: 80px;">
        <el-button type="primary" @click="handleSubmit">提交</el-button>
        <el-button>取消</el-button>
      </div>-->
    </div>
  </div>
</template>

<script>
import config from "@/config/index.js";
import { submitData } from "@/api/plannDesignBudget/consulting.js";
export default {
  data() {
    return {
      formData: {
        consultTime: null,
        reviewTime: null,
        consultLeader: "",
        consultMember: "",
        consultReviewSituation: "",
        expertConsultAdviceFileId: ""
      },
      formDataRules: {
        consultTime: [
          { required: true, message: "请选择", type: "date", trigger: "change" }
        ],
        reviewTime: [
          { required: true, message: "请选择", type: "date", trigger: "change" }
        ],
        consultLeader: [{ required: true, message: "请输入", trigger: "blur" }],
        consultMember: [{ required: true, message: "请输入", trigger: "blur" }],
        consultReviewSituation: [
          { required: true, message: "请输入", trigger: "blur" }
        ],
        expertConsultAdviceFileId: [
          { required: true, message: "请上传", trigger: "blur" }
        ]
      },
      uploadUrl: config.uploadUrl
    };
  },
  methods: {
    //文件上传成功回调
    handleUploadSuccess: function(res, file, fileList) {
      this.formData.expertConsultAdviceFileId = res.data.id;
    },
    //数据提交
    handleSubmit: function() {
      let isTrue = false;
      this.$refs["formData_1"].validate(valid => {
        isTrue = Boolean(valid);
      });
      this.$refs["formData_2"].validate(valid => {
        isTrue = Boolean(valid);
      });
      if (isTrue) {
      }
    }
  }
};
</script>

<style scoped lang="scss">
.cityReview {
  padding: 20px 20px 0 20px;
  min-height: calc(100vh - 154px);
  background-color: #fff;
  .x-main {
    padding: 20px;
    background-color: #fff;
    .x-step_title {
      font-size: 18px;
      font-family: PingFang SC;
      font-weight: bold;
      line-height: 25px;
      color: rgba(77, 77, 77, 1);
      margin-bottom: 30px;
      // padding-left:80px;
    }
  }
}
.d-flex {
  display: flex;
  justify-content: flex-end;
}
</style>
<style lang="scss" scoped>

/deep/ .el-form-item__label {
  color: #a1a1a1;
}

.btn {
  margin-top: 30px;
}
</style>